<%@ page contentType="text/html;charset=utf-8" pageEncoding="utf-8" %>
<%@ page import="view.DataList,dao.Score,dao.Student.Data" %>
<% String root = request.getContextPath() + "/"; %>
<% Data stud = (Data) request.getAttribute("stud"); %>
<div class="container">
    <h1><%= stud.getName() %>的成绩</h1>
    <table class="table table-striped">
        <tr>
            <td>科目</td>
            <td>分数</td>
            <td>操作</td>
        </tr>

        <% DataList<Score.Data> dl = (DataList<Score.Data>) request.getAttribute("list"); %>
        <% Score.Data d;
        while((d = dl.next()) != null) { %> 
        <tr>
            <td><%= d.getSubject() %></td>
            <td><%= d.getScore() %></td>
            <td>
                <a href="<%= root %>teacher/manager/score/edit?id=<%= d.getId() %>">修改</a>
                <a href="<%= root %>teacher/manager/score/del?stud=<%= stud.getId() %>&id=<%= d.getId() %>">删除</a>
            </td>
        </tr>
        <% } %>
    </table>
    <a class="btn btn-primary btn-lg" href="<%= root %>teacher/manager/score/add?id=<%= stud.getId() %>">添加</a>
    <a class="btn btn-warning btn-lg" href="<%= root %>teacher/manager/index">返回</a>
</div>
